package com.citi.xylophone.phoneEmulator.htmlExecutor;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.NameValuePair;

import com.citi.xylophone.phoneEmulator.global.GlobalSwap;
import com.citi.xylophone.phoneEmulator.htmlExecutor.model.ExecutorResult;



public class ExecutorInstruction {
	
	private HttpClient httpClient = new HttpClient();
	
	public ExecutorResult executeSimpleRequest(NameValuePair params[]) throws Exception{
		
		if (!GlobalSwap.getConnect()){
			return null;
		}
		String baseURL = GlobalSwap.getURL();
		ExecutorHttpClient httpClientExecutor = new ExecutorHttpClient();
		return FactoryInstructionResult.generatedInstructionResult(httpClientExecutor.execute(httpClient,baseURL,params,"phomeEmulator"));
	}
	
	
}
